package com.wzy.controller;

import com.wzy.annotation.SystemLog;
import com.wzy.domain.ResponseResult;
import com.wzy.domain.bo.SysCommentMsgBO;
import com.wzy.domain.vo.PageVO;
import com.wzy.service.SysMessageService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 系统消息 控制层
 *
 * @author ultima
 * @version 2022/10/29 20:57
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/message")
public class SysMessageController
{
    private final SysMessageService sysMessageService;

    /**
     * 获取未读消息数
     */
    @GetMapping("/getSystemMessageNum")
    @SystemLog(basenessName = "获取未读消息数")
    public ResponseResult<Map<String, Integer>> getSystemMessageNum()
    {
        return sysMessageService.getSystemMessageNum();
    }

    /**
     * 修改消息状态
     */
    @PutMapping("/updateSysMessageStatus")
    @SystemLog(basenessName = "修改消息状态")
    public ResponseResult<Map<String, Integer>> updateSysMessageStatus(String type)
    {
        return sysMessageService.updateSysMessageStatus(type);
    }

    /**
     * 查询“回复我的”系统消息
     */
    @GetMapping("/getSysCommentMsgList")
    @SystemLog(basenessName = "查询“回复我的”系统消息")
    public ResponseResult<PageVO> getSysCommentMsgList(SysCommentMsgBO sysCommentMsgBO)
    {
        return sysMessageService.getSysCommentMsgList(sysCommentMsgBO);
    }

}
